package com.yuexun.beilunpatient.ui.inspect.adapter;

import android.widget.AbsListView;
import android.widget.ImageView;
import android.widget.TextView;

import com.yuexun.beilunpatient.R;
import com.yuexun.beilunpatient.ui.inspect.bean.CheckRow;

import org.kymjs.kjframe.widget.AdapterHolder;
import org.kymjs.kjframe.widget.KJAdapter;

import java.util.Collection;

/**
 * Created by chenss on 2018/10/11.
 */
public class InspectListAdapter extends KJAdapter<CheckRow> {


    public InspectListAdapter(AbsListView view, Collection<CheckRow> mDatas, int itemLayoutId) {
        super(view, mDatas, itemLayoutId);
    }

    @Override
    public void convert(AdapterHolder adapterHolder, CheckRow injectionList_exreqlist, boolean b) {
        TextView testlist_item_statu = (TextView) adapterHolder.getView(R.id.testlist_item_status);
        ImageView ic_arrow = (ImageView) adapterHolder.getView(R.id.ic_arrow);
        adapterHolder.setText(R.id.testlist_item_name, "项目名称：" + injectionList_exreqlist.getItem_name());
//        adapterHolder.setText(R.id.testlist_item_status, injectionList_exreqlist.getStatusname());
        if(injectionList_exreqlist.getCreate_dtime().length()>16) {
            adapterHolder.setText(R.id.testlist_item_time, "检查时间:" + injectionList_exreqlist.getCreate_dtime().substring(0, 16));
        }
        else {
            adapterHolder.setText(R.id.testlist_item_time, "检查时间:" + injectionList_exreqlist.getCreate_dtime());
        }

//        if (Integer.valueOf(injectionList_exreqlist.getStatuscode()) >= 11 && Integer.valueOf(injectionList_exreqlist.getStatuscode()) <= 90) {
//            testlist_item_statu.setTextColor(mCxt.getResources().getColor(R.color.gray));
//            ic_arrow.setVisibility(View.VISIBLE);
//        } else {
//            testlist_item_statu.setTextColor(mCxt.getResources().getColor(R.color.app_theme_color));
//            ic_arrow.setVisibility(View.INVISIBLE);
//        }
    }
}
